/**
 * @description home页面的api接口
 * @author 印明帝
 */

const router = require('koa-router')()
const { loginCheck } = require('../../middleware/loginCheck')
const { getHome,getHomeBlogList,getAtList } = require('../../control/home')
 
router.prefix('/api')

// 获取首页数据
router.get('/home',loginCheck,async (ctx,next) => {
  ctx.body = await getHome(ctx)
})

// 获取首页的加载更多
router.get('/home/loadMore',loginCheck,async (ctx,next) => {
  ctx.body = await getHomeBlogList(ctx)
})

// 获取at的人的列表
router.get('/home/atList',loginCheck,async (ctx,next) => {
  ctx.body = await getAtList(ctx)
})

module.exports = router